import React, { Component, PropTypes } from 'react';
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux';

//注意，不要直接这样做，要区分开发环境和生产环境
// import DevTools from '../containers/DevTools';

import {
  BrowserRouter as Router,
  Route,
  Link,
  withRouter
} from 'react-router-dom'
import action_hello from '../redux/action/hello'

class Hello extends React.Component {
  constructor(props) {
    super(props)
    // this.props.fetchStoryDetail();
  }
  componentWillMount() {
    let { dispatch } = this.props;
    dispatch(action_hello.fetchStoryDetail());

  }
  render() {
    return (
      <div className="hello">
        <nav>
          <Link to='/about'>
            关于
            </Link>
        </nav>
        {/*<DevTools />*/}
      </div>
    );
  }
}


function mapStateToProps(state) {
  const { hello } = state.reducers;
  // console.log(hello)
  return { hello }
}
function mapDispachToProps(dispatch) {
  return bindActionCreators(action_hello, dispatch)
}

export default withRouter(connect(mapStateToProps)(Hello));